<? include 'server_config.php'; 


$verify_code = $_GET['key'];

if($verify_code!="")
{
	$sql="
		SELECT user_idx FROM ndd_user WHERE verify_code = '$verify_code' AND mail = '".$_GET['user']."';";

//echo $sql;
	$result = mysql_query($sql,$connect);
	$row = mysql_fetch_row($result);

	$_SESSION['user_idx'] = $row[0];

	$findpw = true;
}
else
{
	$findpw = false;
}

if($_SESSION['user_idx'] == "")
{
	?>
	<script>

		<?
	if($findpw)
	{

			?>
		alert("보안상의 이유로 현재 코드는 더이상 사용하실 수 없습니다. 다시 비밀번호 찾기 요청을 해 주세요.");
				<?
	}
			?>
		location.href='login.php';
	</script>
	<?
	return;
}





?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
	<title> New Document </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="Stylesheet" type="text/css" href="./css/nddCommon.css" />
	<script type="text/javascript" src="./js/jquery-1.6.2.min.js"></script>
	<script type="text/javascript" src="./js/region.js" ></script>
	
</head>

 <body>
	<div id='wrapper'>
		<?
        include "top_menu.php";
        ?>
		
		<div id='left_bg'>
		</div>


		<div id='title'>
			<div id='title_margin_top'><span></span></div>
			<div style='width:195px;height:29px;float:left;'></div>
			<div style='width:41px;height:29px;float:left;'><img src="./img/top_icon_input.png"></div><div style='height:29px;float:left;margin-top:3px;'><span id='article_content' >비밀번호를 변경합니다.</span></div>
		</div>
		
		<?
		$current_file = basename(__FILE__);
		include 'side_menu_manage.php';
		?>

		<div id='middle_bg'>
		</div>

		<div id='document_content' style="width:776px;float:left;">
			<div style='height:2px;width:100%;background:#cccccc;float:left;'><span><span></div>
			<div style='height:3px;width:100%;float:left;'><span><span></div>

			<div style="width:714px;background:#F2F2F2;float:left;border:1px solid #E9E9E9;padding:30px;">
				
				<form name="fwrite" action="ndd_member_pw_proc.php"  method="post" enctype="multipart/form-data"  id="fwrite">
				
				<input type='hidden' name='findpw' value='<?=$findpw?>'>
<? 
if(!$findpw)
{
	?>
				<div style="width:30px;height:30px;float:left;"></div>
				<div style="width:600px;float:left;">
					기존 비밀번호<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="password" name="prev_password"><br>
					
				
				</div>
				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

<?
}
				?>

				<div style="width:30px;height:30px;float:left;"></div>
				<div style="width:600px;float:left;">
					새 비밀번호<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="password" name="new_password"><br>
					
				
				</div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

				<div style="width:30px;height:30px;float:left;"></div>
				<div style="width:600px;float:left;">
					새 비밀번호 확인<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="password" name="new_password_confirm"><br>
					
				
				</div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>


				
				
				<div style='width:100%;height:30px;padding-left:30px;float:left;'>
						<a  onclick="fwrite.submit();" style="cursor:pointer"><img src='./img/ndd_talk_save.png' border="0"></a>&nbsp;<a style='cursor:pointer;' onclick='history.back();'><img src='./img/ndd_talk_cancel.png' border="0"></a>
						
				</div>
				
				
				</form>
			
			</div>
			<? include "footer.php";?>		
		</div>

		
		<iframe src='' name='ifr_temp' style='display:none;'></iframe>



	</div>
 </body>
</html>
